using UnityEngine;
using QFramework;

namespace ProjectSurvivor
{
	public partial class Bomb : ViewController
	{
		void Start()
		{
			// Code Here
		}
		void OnTriggerEnter2D(Collider2D other)
		{
			if (other.GetComponent<CollectableArea>())
			{
				foreach (var enemyObj in GameObject.FindGameObjectsWithTag("Enemy"))
				{
					var enemy = enemyObj.GetComponent<Enemy>();
					if (enemy && enemy.gameObject.activeSelf)
					{
						enemy.Hurt(enemy.Hp);
					}
				}
				AudioKit.PlaySound("bomb");
				CarmController.Shake();
				this.DestroyGameObjGracefully();
			}
		}
	}
}
